﻿<h1>Listing departments</h1>

<table border="1">
  <tr>
    <th>科室名称</th>
    <th>显示顺序</th>
    <th>操　　作</th>
  </tr>
  
<% for department in @departments %>
  <tr>
  <% for column in Department.content_columns %>
    <td><%=h department.send(column.name) %></td>
  <% end %>
    <td><%= link_to '显示', :action => 'show', :id => department %>
        <%= link_to '修改', :action => 'edit', :id => department %>
        <%= link_to '删除', { :action => 'destroy', :id => department }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= button_to '增加新部门', :action => 'new' %>
